package com.anli02.entity.vo;

import com.anli02.entity.pojo.OnlineMusic;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
@Data
public class OnlineMusicDoc implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "music", type = IdType.ASSIGN_ID)
    private String music;

    private String userid;

    private String musicName;

    private String fileLocation;

    private LocalDate uploadDate;

    private Integer likes;

    private Integer views;

    private Integer comments;
    /**
     *     private BigDecimal latitude;
     *
     *     private BigDecimal longitude;
     */
    private String location;
    //重写构造--需要传递原类型-自动转es类型
    public OnlineMusicDoc(OnlineMusic onlinemusic) {
        this.location = onlinemusic.getLatitude() + ", " + onlinemusic.getLongitude();
        this.music = onlinemusic.getMusic();
        this.userid = onlinemusic.getUserid();
        this.musicName = onlinemusic.getMusicName();
        this.fileLocation = onlinemusic.getFileLocation();
        this.uploadDate = onlinemusic.getUploadDate();
        this.likes = onlinemusic.getLikes();
        this.views = onlinemusic.getViews();
        this.comments = onlinemusic.getComments();

    }



}